# Maintainer: Bruno Pagani <archange@archlinux.org>

_pkg=pyct
pkgname=python-${_pkg}
pkgver=0.5.0
pkgrel=2
pkgdesc="Python packaging Common Tasks"
arch=(any)
url="https://github.com/pyviz-dev/pyct"
license=(BSD)
depends=(python-param)
makedepends=(python-setuptools)
checkdepends=(python-pytest python-requests python-yaml)
source=(https://files.pythonhosted.org/packages/source/${_pkg::1}/${_pkg}/${_pkg}-${pkgver}.tar.gz)
sha256sums=('dd9f4ac5cbd8e37c352c04036062d3c5f67efec76d404761ef16b0cbf26aa6a0')

build() {
    cd ${_pkg}-${pkgver}
    python setup.py build
}

check() {
    cd ${_pkg}-${pkgver}
    pytest pyct -v --pyargs
}

package() {
    cd ${_pkg}-${pkgver}
    python setup.py install --prefix=/usr --root="${pkgdir}" --skip-build --optimize=1

    install -Dm644 LICENSE.txt -t "${pkgdir}"/usr/share/licenses/${pkgname}
}
